package com.nstc.ibd.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtil {
    public static Connection getConn(String username, String pwd, String oracleDatabase) {
        Connection conn = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            conn = DriverManager.getConnection(oracleDatabase, username, pwd);
        } catch (Exception e) {
        }
        return conn;
    }

    public static void closeConnection(Connection conn) {
        try {
            if ((conn != null) && (!conn.isClosed())) {
                conn.close();
            }
        } catch (SQLException e) {
        }
    }

}
